package cn.itcast.mapper;

import cn.itcast.pojo.permission;
import cn.itcast.pojo.permissionExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;

public interface permissionMapper {
    int countByExample(permissionExample example);

    int deleteByExample(permissionExample example);

    int deleteByPrimaryKey(Integer permissionId);

    int insert(permission record);

    int insertSelective(permission record);

    List<permission> selectByExample(permissionExample example);

    permission selectByPrimaryKey(Integer permissionId);

    int updateByExampleSelective(@Param("record") permission record, @Param("example") permissionExample example);

    int updateByExample(@Param("record") permission record, @Param("example") permissionExample example);

    int updateByPrimaryKeySelective(permission record);

    int updateByPrimaryKey(permission record);

    /**
     * 根据管理员所有的管理员id查询该管理员所拥有的的权限
     * @param roleIds
     * @return
     */
    List<permission> getPermissionByRoleIds(List<Integer> roleIds);

    /**
     * 根据所有的权限id查询所有的权限信息
     * @param permissionIds
     * @return
     */
    List<permission> getPermissionsByList(List<Integer> permissionIds);
}